import router from './index';
import store from '../store'

//全局前置守卫
router.beforeEach((to, from, next) => {
    if (to.meta.isLogin) { //该页面是否需要登录
        let token = store.state.loginModule.userInfo.token;
        if (token) { //验证token是否存在
            next()
        } else {
            // next({ path: '/loginDetail' })
            next()
        }
    } else {
        next()
    }
})